<template>
    <div>
        <h1>我是App</h1>
        <h1>{{count}}</h1>
        <Child @countPlus="countPlus"></Child>
    </div>
</template>

<script>
import Child from "@/components/Child";
export default {
    name: "App",
    components: {
        Child,
    },
    data() {
        return {
            count: 0,
        };
    },
    methods: {
        countPlus(val) {
            this.count = this.count + val;
        },
    },
};
</script>

<style></style>
